<?php
 function getProcessInfo($pid=0) { global $db; if($pid > 0) { $sql = "select * from  process_management where id = '".$pid."'"; $result = $db->query_first($sql); return $result; } else { $dataAry = array(); $sql = "select * from  process_management"; $query = $db->query($sql); while($row = $db->fetch_array($query)) { $dataAry[] = $row; } return $dataAry; } } function getNodeNameInfo($param="name") { $nodeNameAry = array(); $processInfoAry = getProcessInfo(); foreach($processInfoAry as $key=>$val) { $configData = json_decode($val["config_data"],true); foreach($configData["nodes"] as $kk=>$vv) { $nodeNameAry[$kk] = $vv[$param]; } } return $nodeNameAry; } 